package com.learnJava.demo;

import java.util.Scanner;

public class Test {

    public static void pay(Card card) {
        System.out.println("请刷卡，请您输入当前消费金额：");
        Scanner sc = new Scanner(System.in);
        double money = sc.nextDouble();
        card.consume(money);

    }

    public static void main(String[] args) {
        // 办一张金卡：创建金卡或者银卡对象，交给独立的业务处理（支付机）来完成，来完成存款和消费
        GoldCard goldCard = new GoldCard("123456", "yjy", "999", 5000);

        SilverCard silverCard = new SilverCard("12138", "clx", "888", 3000);

        pay(goldCard);
    }

}
